class ChangeTrafficFlowToIntegerType < ActiveRecord::Migration
  def up
    add_column :traffics, :new_column, :bigint
    Traffic.reset_column_information
    Traffic.all.each do |m|
      m.update_attribute :new_column, m.flow.to_i
    end
    remove_column :traffics, :flow
    rename_column :traffics, :new_column, :flow
  end

  def down
    change_column :traffics, :flow, :string
  end
end